<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<script type="text/javascript">
	$(function() {
		var ids = "${userIds}";
		$.each($("input[name='userIds']"),function(i, n){
			var value = $(n).val();
			var index = ids.indexOf(value);
			if(index!=-1) $(n).attr("checked", "checked");
		})
	})
</script>
<div class="columns">
	<div class="new-row-mobile six-columns six-columns-tablet eleven-columns-mobile">
		<form id="ask-form">
			<h3 class="thin underline">咨询信息</h3>
			<p class="inline-label button-height">
				<label class="label">标题：</label>
				<input type="text" class="input" readonly="readonly" value="${ask.title }">
			</p>
			<p class="inline-label button-height">
				<label class="label">内容：</label>
				<textarea class="input full-width autoexpanding"
				 readonly="readonly" style="height:100px;">${ask.text }</textarea>
			</p>
			<div class="inline-label button-height" id="user-p">
				<label class="label">提给：</label>
				<fieldset class="fieldset">
					<legend class="legend">教师</legend>
					<c:forEach items="${teachers }" var="teacher">
						<input type="checkbox" name="userIds" value="${teacher.id }"> 
						<label for="radio-1" class="label">${teacher.username }</label>
					</c:forEach>
				</fieldset>
				<fieldset class="fieldset">
					<legend class="legend">专家</legend>
					<c:forEach items="${experts }" var="expert">
						<input type="checkbox" name="userIds" value="${expert.id }"> 
						<label for="radio-1" class="label">${expert.username }</label>
					</c:forEach>
				</fieldset>
			</div>
			<br>
		</form>
	</div>
	<div class="new-row-mobile six-columns six-columns-tablet eleven-columns-mobile">
		<h3 class="thin underline">历史回复</h3>
		<c:forEach items="${replys }" var="reply">
		<fieldset class="fieldset">
			<legend class="legend">${reply.replier_name }&emsp;${reply.reply_time }</legend>
			<textarea class="input full-width autoexpanding" style="height:100px;">${reply.text }</textarea>
		</fieldset>
		</c:forEach>
	</div>
</div>
